$(function(){
	$("#myCarousel .item").css('height', $(window).height());
	
	/* maps */
	var sofia_lang = 42.69737, 
		sofia_lat = 23.33519, 
		sofia_map_id = "map_canvas_sofia",
		plovdiv_lang = 42.145396, 
		plovdiv_lat = 24.749126, 
		plovdiv_map_id = "map_canvas_plovdiv"
		varna_lang = 43.204988, 
		varna_lat = 27.912556, 
		varna_map_id = "map_canvas_varna"
		blago_lang = 42.01241, 
		blago_lat = 23.09549, 
		blago_map_id = "map_canvas_blago",
		zagora_lang = 42.42774, 
		zagora_lat = 25.62604, 
		zagora_map_id = "map_canvas_stara_zagora",
		burgas_lang = 42.49700, 
		burgas_lat = 27.46871, 
		burgas_map_id = "map_canvas_burgas";
		
	function initializeMaps(lang, lat, map_id) {
		var secheltLoc = new google.maps.LatLng(lang, lat);

		var myMapOptions = {
			zoom : 17,
			center : secheltLoc,
			mapTypeId : google.maps.MapTypeId.ROADMAP,
			scrollwheel : false
		};
		var theMap = new google.maps.Map(document.getElementById(map_id), myMapOptions);

		var marker = new google.maps.Marker({
			map : theMap,
			draggable : false,
			position : new google.maps.LatLng(lang, lat),
			visible : true
		});

		marker.setIcon('assets/img/icons/marker.png');
		google.maps.event.addListener(marker, "click", function() {
			window.open(theater);
		});


		var myOptions = {
			disableAutoPan : false,
			maxWidth : 0,
			pixelOffset : new google.maps.Size(-140, 0),
			zIndex : null,
			isHidden : false,
			pane : "floatPane",
			enableEventPropagation : false
		};

		google.maps.event.addListener(marker, "click", function(e) {
			ib.open(theMap, this);
		});

		var ib = new InfoBox(myOptions);
		ib.open(theMap, marker);
	}

		google.maps.event.addDomListener(window, 'load', initializeMaps(blago_lang, blago_lat, blago_map_id));
		google.maps.event.addDomListener(window, 'load', initializeMaps(sofia_lang, sofia_lat, sofia_map_id));
		google.maps.event.addDomListener(window, 'load', initializeMaps(plovdiv_lang, plovdiv_lat, plovdiv_map_id));
		google.maps.event.addDomListener(window, 'load', initializeMaps(varna_lang, varna_lat, varna_map_id));
		google.maps.event.addDomListener(window, 'load', initializeMaps(zagora_lang, zagora_lat, zagora_map_id));
		google.maps.event.addDomListener(window, 'load', initializeMaps(burgas_lang, burgas_lat, burgas_map_id));

});
